import 'dart:math';

import 'package:flutter/material.dart';
import 'package:pipedream_lighting/src/tool/assets.dart';

///控制旋转按钮的模型
class RotateModel {
  String backImg;
  final String tintImg;
  final String title;
  final double start;
  final double end;
  final bool snapping;
  final padding;
  final max;
  final min;
  final value;
  final unit;

  RotateModel({
    this.backImg = '',
    this.tintImg = '',
    this.title = '',
    this.start = 0,
    this.end = 0,
    this.snapping = false,
    this.padding,
    this.max = 1,
    this.min = 0,
    this.value = 0,
    this.unit = 0,
  });
}

///三个旋转按钮的数据配置
List<String> _backimg_list = [
  assets.xuan_kedu,
  assets.s_white,
  assets.xuan_kedu
];
List<String> _title_list = ['Speed', 'Mode', 'Bright'];
List<int> _max_list = [31, icon_list.length - 1, 10];
List<int> _min_list = [1, 0, 1];
List<RotateModel> rotateModel_list =
    List.generate(_backimg_list.length, (index) {
  return RotateModel(
      backImg: _backimg_list[index],
      tintImg: assets.xuan,
      title: _title_list[index],
      // martin: index == 1 ? 15 : 4,
      // backImgBottom: index == 1 ? 60 : 12,
      padding: index == 1
          ? EdgeInsets.zero
          : EdgeInsets.only(
              top: 6 * GlobalConfig.scaleH, bottom: 6 * GlobalConfig.scaleH),
      start: pi / 4,
      end: 3 * pi / 4,
      snapping: false,
      max: _max_list[index],
      min: _min_list[index],
      value: index == 1 ? (icon_list.length - 1) / 2 : _min_list[index],
      unit: 1);
}).toList();

List<Map<String, int>> icon_list = [
  {assets.g_sevencolor: 0x25},
  {assets.g_red: 0x26},
  {assets.g_green: 0x27},
  {assets.g_blue: 0x28},
  {assets.g_yellow: 0x29},
  {assets.g_cyan: 0x2A},
  {assets.g_purpple: 0x2B},
  {assets.g_white: 0x2C},
  {assets.g_redgreen: 0x2D},
  {assets.g_redblue: 0x2E},
  {assets.g_gblue: 0x2F},
  {assets.s_sevencolor: 0x30},
  {assets.s_red: 0x31},
  {assets.s_green: 0x32},
  {assets.s_blue: 0x33},
  {assets.s_yellow: 0x34},
  {assets.s_cyan: 0x35},
  {assets.s_purpple: 0x36},
  {assets.s_white: 0x37},
];
